<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
	String basePath = "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="/">
    <!-- 下拉框 -->
    <link rel="stylesheet" href="static/ace/css/chosen.css"/>

    <link href="plugins/kindeditor/themes/simple/simple.css" type="text/css" rel="stylesheet">
    <link rel="stylesheet" href="static/ace/css/datepicker.css"/>
    <link href="//cdn.bootcss.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet">
    <!-- jsp文件头和头部 -->
    <%@ include file="../index/top.jsp" %>
    <style>
        .disabled {
            color: #000;
            cursor: default;
        }

        .disabled:hover {
            color: #000;
            text-decoration: none;
        }
    </style>
</head>
<body class="no-skin">
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <form action="fruitUser/addMember.do" name="goodsForm"
                              id="goodsForm" method="post">
                            <div id="zhongxin" style="padding-top: 13px;">
                                <table id="table_report"
                                       class="table table-striped table-bordered table-hover">
                                    <tr>
                                        <td align="center">手机号:&nbsp;&nbsp;<input type="text" name="phone"
                                                               id="phone" 
                                                               maxlength="11" placeholder="这里输入手机号"  title="手机号"
                                                               style="width: 40%;"/></td>
                                    </tr>
                                    <tr>
                                        <td align="center">密码:&nbsp;&nbsp;<input type="text" name="pwd"
                                                               id="pwd" 
                                                               maxlength="6" min="6" placeholder="这里输入密码" title="密码"
                                                               style="width: 40%;"/>
                                        </td>
                                    </tr>
                                    <tr>
                                         <td align="center">邀请码:&nbsp;&nbsp;<input type="text" name="parentName"
                                                               id="parentName" 
                                                               maxlength="6" min="6" placeholder="这里输入邀请码" title="邀请码"
                                                               style="width: 40%;"/>
                                        </td>
                                    </tr>
                                </table>
                                <table id="table_report1"
                                       class="table table-striped table-bordered table-hover">
                                    <tr>
                                        <td style="text-align: center;" colspan="10">
                                                <a class="btn btn-mini btn-primary"
                                                   onclick="save();">注册</a>
                                            <a class="btn btn-mini btn-danger"
                                               onclick="top.Dialog.close();">取消</a>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div id="zhongxin2" class="center" style="display: none">
                                <br/> <br/> <br/> <br/> <img
                                    src="static/images/jiazai.gif"/><br/>
                                <h4 class="lighter block green"></h4>
                            </div>
                        </form>
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content -->
        </div>
    </div>
    <!-- /.main-content -->
</div>


<!-- /.main-container -->
<!-- basic scripts -->
<!-- 页面底部js¨ -->
<%@ include file="../index/foot.jsp" %>
<!-- ace scripts -->
<script src="static/ace/js/ace/ace.js"></script>
<!-- inline scripts related to this page -->
<!-- 下拉框 -->
<script src="static/ace/js/chosen.jquery.js"></script>
<!--提示框-->
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
<script type="text/javascript" src="static/js/common/file_upload.js"></script>
<script type="text/javascript" src="plugins/kindeditor/kindeditor-all.js"></script>
<script type="text/javascript" src="plugins/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript" src="static/laydate/laydate.js"></script>
<script type="text/javascript" src="static/js/provincial.municipal.league.js"></script>
<!-- <script type="text/javascript" src="http://www.gongjuji.net/Content/files/jquery.md5.js"></script> -->
<script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js"></script>

</body>
<script type="text/javascript">
    $(top.hangge());
    var itemAddEditor;
    var currentIndex = 0;
    //页面初始化完毕后执行此方法
    var min_ratio = $("#min_ratio").val();
    var max_ratio = $("#max_ratio").val();
    var pa=/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,6}$/;
    var phone_reg = /^1[3|4|5|7|8]\d{9}$/;
    
    function save() {
        var phone = $("#phone").val();
        var pwd = $("#pwd").val();
        var parentName = $("#parentName").val();
        
        if ($.trim(phone) == "") {
            alert("请输入用户手机号码！");
            return false;
        }
        if ($.trim(pwd) == "") {
            alert("请输入密码!");
            return false;
        }
        if(!phone_reg.test(phone)){ 
        	alert("用户手机号码格式错误！");
            return false;
        }
        if(!pa.test(pwd)){ 
        	alert("用户密码格式错误！");
            return false;
        }
        if ($.trim(parentName) != "") {
        	if ($.trim(parentName).length !=6) {
                alert("邀请码输入有误");
                return false;
            }
        }
        $("#pwd").val(md5(pwd)); 
        $("#goodsForm").submit();
        $("#zhongxin").hide();
        $("#zhongxin2").show();
    }

</script>
</html>